package cn.blnp.net.flowable.task.manually;

import cn.hutool.core.date.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.flowable.bpmn.model.FlowElement;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.ExecutionListener;
import org.springframework.stereotype.Component;

/**
 * <h3></h3>
 *
 * @author <a href="mailto:blnp.yibin@qq.com">lyb</a>
 * @version 1.0
 * @since 2025/5/12 15:49
 */
@Slf4j
@Component
public class ManualTaskExecutionListener implements ExecutionListener {

    @Override
    public void notify(DelegateExecution execution) {
        //获取当前节点信息
        FlowElement currentFlowElement = execution.getCurrentFlowElement();
        log.info("到达手动任务，当前节点名称：{}，备注：{}", currentFlowElement.getName(),
                currentFlowElement.getDocumentation());
        log.info("处理结果：({}) 奖品线下发放完成！", DateUtil.now());
    }
}
